Skip to content

fix(fullstack init --next): replace stale root README/CLAUDE.md, suppress noisy noConfirm hint#81

Merged
pascal-klesse merged 1 commit into
mainfrom
fix/next-fullstack-root-files-and-hint
Apr 30, 2026
Merged

fix(fullstack init --next): replace stale root README/CLAUDE.md, suppress noisy noConfirm hint#81
pascal-klesse merged 1 commit into
mainfrom
fix/next-fullstack-root-files-and-hint

Conversation

@pascal-klesse

Copy link
Copy Markdown
Member

Summary

Three fixes that surfaced from a fresh lt fullstack init --next test run, plus one supporting test-isolation patch.

Bugs

  1. Stale root README.mdlt fullstack init --next inherits the root README.md from lt-monorepo, which describes the legacy MongoDB + lerna stack. None of it applies to the --next project (Bun + Prisma 7 + Postgres + Better-Auth + REST). Confuses humans, poisons AI agent context.

  2. Stale root CLAUDE.md — same issue. The cloned CLAUDE.md mentions `@lenne.tech/nest-server` npm-vs-vendor, `mongooseTenantPlugin`, GraphQL schema generation, `@UnifiedField` — all explicitly out of scope for nest-base. Because root `CLAUDE.md` is auto-loaded by Claude Code as repo orientation, this misleads every agent that opens the workspace.

  3. `Hint: Non-interactive mode detected` false positivetools.nonInteractiveHint() prints even when the caller already passed every required flag plus `--noConfirm`. Just noise in the output.

  4. (Supporting) Flaky `tests/git-commands.test.ts` — `isWorkingDirectoryClean` used `git status --porcelain` which counts untracked files. Parallel jest tests scatter `tests/temp-api-mode-*` directories during the run, breaking the check intermittently. `--untracked-files=no` fixes it. Also added a `hasUpstream` guard to the `lt git update` test — fresh feature branches before `git push -u` can't pull-rebase, which is a config gap, not a regression.

Changes

  • Add `src/templates/next-fullstack/` with three EJS templates:

    • `README.md.ejs` — minimal workspace overview pointing at `projects/api/` and `projects/app/`.
    • `CLAUDE.md.ejs` — routing card to subproject `CLAUDE.md` files plus an explicit out-of-scope list (no GraphQL, Mongo, vendor-mode, legacy decorators).
    • `.claude/QUICKSTART.md.ejs` — 60-second agent onboarding card with a routing table and the dev bring-up sequence (including the `docker compose down -v` hint when re-running setup).
  • `src/commands/fullstack/init.ts` — when `experimental` is true, render the `next-fullstack` templates over the cloned `lt-monorepo`'s root files instead of just patching the legacy `{{TEMPLATE_VAR}}` placeholders. Classic flow unchanged.

  • `src/extensions/tools.ts` — `nonInteractiveHint()` skips the yellow hint when the caller already passed `--noConfirm`.

  • `tests/git-commands.test.ts` — switch `isWorkingDirectoryClean` to `--untracked-files=no`, add `hasUpstream` guard.

Test plan

  • `npm run lint` — clean
  • `npm test` — 153 passed (was flaky on `git-commands.test.ts` before this PR; now consistent)
  • Local smoke: `lt fullstack init --name foo --frontend nuxt --next --noConfirm` produces a workspace with a sane root README + CLAUDE.md + .claude/QUICKSTART.md and no spurious "Hint: Non-interactive mode" line.

🤖 Generated with Claude Code

…ress noisy noConfirm hint

When `lt fullstack init --next` runs, the workspace inherits root
README.md and CLAUDE.md from `lt-monorepo`, which describe the legacy
MongoDB + GraphQL + Mongoose + vendor-mode stack — none of which
applies to the new `nest-base` template (Bun + Prisma 7 + Postgres +
Better-Auth + REST). Leaving them in place poisoned every AI agent's
context (they're auto-loaded as repo orientation) and confused human
readers.

Changes:

- Add `src/templates/next-fullstack/`:
  - `README.md.ejs` — minimal workspace overview pointing at projects/
  - `CLAUDE.md.ejs` — routing card to subproject CLAUDE.md files +
    explicit out-of-scope list (no GraphQL / Mongo / vendor-mode)
  - `.claude/QUICKSTART.md.ejs` — 60-second agent onboarding card with
    a routing table and the dev bring-up sequence

- `init.ts`: when `experimental` is true, render the next-fullstack
  templates over the cloned `lt-monorepo`'s root files instead of just
  patching `{{TEMPLATE_VAR}}` placeholders. Classic flow unchanged.

- `tools.nonInteractiveHint()`: skip the yellow hint when the caller
  already passed `--noConfirm`. They're deliberately running headless
  and don't need a "use parameters to skip prompts" reminder when they
  already passed every parameter.

Friction-log entries fixed (from a fresh `--next` test run): root README
stale, root CLAUDE.md contradicts nest-base, root .claude/QUICKSTART.md
missing, "Hint: Non-interactive mode" prints with all flags supplied.

Tests: 153 passed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@pascal-klesse pascal-klesse merged commit 9adb271 into main Apr 30, 2026
1 check passed
@pascal-klesse pascal-klesse deleted the fix/next-fullstack-root-files-and-hint branch April 30, 2026 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant